#include <iostream>
#include "Log.hpp"
#include "Task.hpp"
#include <memory>
#include "threadpool.hpp"
using namespace std;




int main() {
    srand(time(nullptr) ^ getpid());
    // unique_ptr<threadpool<Task>> tp = unique_ptr<threadpool<Task>>(new threadpool<Task>(20));
    threadpool<Task>* tp = threadpool<Task>::GetInstance();
    tp->Start();
    while (true) {
        Task t;
        int x = rand() % 100 + 1;
        usleep(1000);
        int y  = rand() % 100 + 1;
        char op = opers[rand() % opers.size()];
        t._x = x;
        t._y = y;
        t._op = op;
        tp->Push(t);
    }
    
    return 0;
}